package com.demo.service.uiv.impl;

import com.demo.common.constant.type.UivCatalogTypeConstant;
import com.demo.dao.common.entity.CatalogItem;
import com.demo.dao.uiv.mapper.UivCatalogMapper;
import com.demo.service.uiv.UivCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UivCatalogServiceImpl implements UivCatalogService {
    @Autowired
    private UivCatalogMapper catalogMapper;

    //******************************************************************
    // 字典分类表
    //******************************************************************
    //查询分辨率
    @Override
    public List<CatalogItem> getResolutionTypeCatalogList(){
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.RESOLUTION_TYPE_CODE);
    }

    //查询颜色类型列表
    @Override
    public List<CatalogItem> getColorTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.COLOR_TYPE_CODE);
    }

    //查询线型类型列表
    @Override
    public List<CatalogItem> getLineStyleTypeCatalogList(){
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.LINE_TYPE_CODE);
    }

    //查询字体列表
    @Override
    public List<CatalogItem> getFontFamilyTypeCatalogList(){
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.FONT_TYPE_CODE);
    }

    //查询字体粗细列表
    @Override
    public List<CatalogItem> getFontWeightTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.FONT_WEIGHT_TYPE_CODE);
    }

    //查询加密类型列表
    @Override
    public List<CatalogItem> getEncryptionTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.ENCRYPTION_TYPE_CODE);
    }

    //查询通信协议列表
    @Override
    public List<CatalogItem> getProtocolTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.PROTOCOL_TYPE_CODE);
    }

    //查询变量公式列表
    @Override
    public List<CatalogItem> getFormulaTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.FORMULA_TYPE_CODE);
    }

    //查询属性数据类型列表
    @Override
    public List<CatalogItem> getPropsDataTypeCatalogList() {
        return catalogMapper.getHmiDictionaryValueByTypeName(UivCatalogTypeConstant.PROPS_DATA_TYPE_CODE);
    }

    //查询属性表单类型列表
    @Override
    public List<CatalogItem> getPropsFormTypeCatalogList() {
        return catalogMapper.getHmiDictionaryValueByTypeName(UivCatalogTypeConstant.PROPS_FORM_TYPE_CODE);
    }

    //查询操作权限列表
    @Override
    public List<CatalogItem> getOperationTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.OPERATION_TYPE_CODE);
    }

    //《图形类型列表》标识码
    @Override
    public List<CatalogItem> getGraphTypeCatalogList() {
        return catalogMapper.getSysDictionaryByTypeName(UivCatalogTypeConstant.GRAPH_TYPE_CODE);
    }

    //查询行业类型
    @Override
    public List<CatalogItem> getFieldTypeCatalogList() {
        return catalogMapper.getSysDictionaryByTypeName(UivCatalogTypeConstant.FIELD_TYPE_CODE);
    }

    //查询图元分类列表
    @Override
    public List<CatalogItem> getTupleTypeCatalogList() {
        return catalogMapper.getSysDictionaryByTypeName(UivCatalogTypeConstant.TUPLE_TYPE_CODE);
    }

    //《事件类型列表》标识码
    @Override
    public List<CatalogItem> getEventTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.EVENT_TYPE_CODE);
    }

    //查询事件行为类型
    @Override
    public List<CatalogItem> getEventOperationTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.EVENT_OPERATION_TYPE_CODE);
    }

    //查询比较运算类型列表
    @Override
    public List<CatalogItem> getOperatorTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.COMPARE_OPERATOR_TYPE_CODE);
    }

    //查询推送信息类型列表
    @Override
    public List<CatalogItem> getNotifyMsgTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.NOTIFY_MSG_TYPE_CODE);
    }

    //查询动效类型列表
    @Override
    public List<CatalogItem> getMotionTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.MOTION_TYPE_CODE);
    }

    //查询报警类型列表
    @Override
    public List<CatalogItem> getAlarmTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.ALARM_TYPE_CODE);
    }

    //《报警处理状态分类列表》接口
    @Override
    public List<CatalogItem> getAlarmDisposeTypeCatalogList() {
        return catalogMapper.getHmiDictionaryByTypeName(UivCatalogTypeConstant.ALARM_DISPOSE_TYPE_CODE);
    }

    //******************************************************************
    // 普通表
    //******************************************************************
    //查询项目列表
    @Override
    public List<CatalogItem> getProjectCatalogList(){
        return catalogMapper.getProjectCatalogList();
    }

    //查询页面列表
    @Override
    public List<CatalogItem> getPageCatalogList(){
        return catalogMapper.getPageCatalogList();
    }

    //查询设备列表
    @Override
    public List<CatalogItem> getDeviceCatalogList(){
        return catalogMapper.getDeviceCatalogList();
    }

    //查询变量列表
    @Override
    public List<CatalogItem> getVariableCatalogList() {
        return catalogMapper.getVariableCatalogList();
    }

    //查询图元列表
    @Override
    public List<CatalogItem> getTupleCatalogListByTypeId(Long typeId) {
        return catalogMapper.getTupleCatalogListByTypeId(typeId);
    }
}
